//
//  BottomPlayView.h
//  Kugou-OC
//
//  Created by BH on 16/4/5.
//  Copyright © 2016年 Sunny. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

@class MusicInfoModel;

@protocol BottomPlayViewDelegate <NSObject>

/**
 *  显示/隐藏 播放列表
 *
 *  @param item   播放器
 *  @param array  播放列表数组
 *  @param index  当前播放索引
 *  @param hidden 是否显示列表 YES:显示 NO:隐藏
 */
-(void)showPlayListViewWithItem:(AVPlayerItem *)item array:(NSArray *)array index:(NSInteger)index hidden:(BOOL)hidden;

@end

/**
 *  底部播放view
 */
@interface BottomPlayView : UIView

@property(nonatomic,strong)UIButton *playBtn;//播放or暂停
@property(nonatomic,strong)UIImageView *iconImg;//歌曲图片
@property(nonatomic,strong)UISlider *silder;//歌曲进度条
@property(nonatomic,strong)UILabel *singNameLab;//歌曲名
@property(nonatomic,strong)UILabel *singerLab;//歌手
//播放列表
@property(nonatomic,strong)NSArray *musicList;
//当前播放歌曲索引
@property(nonatomic,assign)NSInteger currentPlayIndex;
//播放器
@property(nonatomic,strong)AVPlayerItem *playerItem;
//计时器
@property(nonatomic,strong)NSTimer *playerTimer;
//当前播放的Item, 用来与播放界面之间的播放信息通讯
@property (nonatomic, strong) AVPlayerItem *currentPlayer;

@property(nonatomic,strong)id<BottomPlayViewDelegate>delegate;

//下一首
@property (nonatomic, copy) void ((^NextSong)());
//处理播放界面的时间显示
@property (nonatomic, copy) void ((^ASTimer)(AVPlayerItem *timer));
//单击底部view
@property(nonatomic,copy)void ((^TapBottomView)(NSArray *array,AVPlayerItem *item,NSInteger index));

+(BottomPlayView *)shareBottomView;

/**
 *  设置当前播放歌曲
 *
 *  @param model 播放歌曲model
 */
-(void)setupPlayerWithModel:(MusicInfoModel *)model;

@end
